package com.spzx.user.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import com.spzx.user.domain.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "RemoteUserInfoService",
            value = "spzx-user",
            fallbackFactory = RemoteUserInfoServiceFallbackFactory.class)
public interface RemoteUserInfoService {


    //用户注册远程调用接口
   @PostMapping("/userInfo/register")
    public R register(@RequestBody UserInfo userInfo,
                       @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    //用户登录校验远程调用接口
    @GetMapping("/userInfo/info/{username}")
    public R info(@PathVariable("username") String username,
                  @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
